#ifndef EGG_MATERIALPASS_H
#define EGG_MATERIALPASS_H

#include "Light.h"
#include "Camera.h"
#include "RenderContext.h"
#include "GlobalGeometryGroup.h"
#include "GlobalGPUParamGroup.h"
#include "GlobalGPUProgramGroup.h"

namespace egg{

    class Material;
    typedef shared_ptr<Material> MaterialPtr;

    class MaterialPass : public GPUParamMap{
    public:
        MaterialPass(GPUProgramPtr _pro);
        virtual void addTo(MaterialPtr _owner);
        virtual void activate(RenderContext& _context);

        inline uint32 getFlags(){
            return mFlags;
        }
        inline const DepthState& getDepthState(){
            return mStateCache.mDepthState;
        }
        inline const BlendState& setBlendState(){
            return mStateCache.mBlendState;
        }
        inline const StateCache& getStateCache(){
            return mStateCache;
        }
    protected:
        uint32 mFlags;
        MaterialPtr mOwner;
        StateCache mStateCache;
    };

}

#endif